<?php

class StudentInfo
{
    /** @var int */
    protected $id = 0;
    /** @var string */
    protected $student_num = null;
    /** @var string */
    protected $student_name = null;
    /** @var string */
    protected $grade = null;


    /**
     * @return School
     */
    public function getSchool()
    {
        if ($this->getSchoolId()) {
            $thisSchool = School_Model::getSchoolById($this->getSchoolId());
            if ($thisSchool) {
                return $thisSchool;
            }
            return new School;
        }
        return new School;
    }

    /**
     * @return array
     */
    public function getDataArray()
    {
        return array(
            'student_num'  => $this->getStudentNum(),
            'student_name' => $this->getStudentName(),
            'grade'        => $this->getGrade(),
            'major'        => $this->getMajor(),
            'user_id'      => $this->getUserId(),
            'school_id'    => $this->getSchoolId(),
        );
    }


    /**
     * @return string
     */
    public function getGrade()
    {
        return $this->grade;
    }

    /**
     * @param string $grade
     */
    public function setGrade($grade)
    {
        $this->grade = $grade;
    }

    /**
     * @return int
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * @param int $id
     */
    public function setId($id)
    {
        $this->id = $id;
    }

    /**
     * @return string
     */
    public function getMajor()
    {
        return $this->major;
    }

    /**
     * @param string $major
     */
    public function setMajor($major)
    {
        $this->major = $major;
    }

    /**
     * @return int
     */
    public function getSchoolId()
    {
        return $this->school_id;
    }

    /**
     * @param int $school_id
     */
    public function setSchoolId($school_id)
    {
        $this->school_id = $school_id;
    }

    /**
     * @return string
     */
    public function getStudentName()
    {
        return $this->student_name;
    }

    /**
     * @param string $student_name
     */
    public function setStudentName($student_name)
    {
        $this->student_name = $student_name;
    }

    /**
     * @return string
     */
    public function getStudentNum()
    {
        return $this->student_num;
    }

    /**
     * @param string $student_num
     */
    public function setStudentNum($student_num)
    {
        $this->student_num = $student_num;
    }

    /**
     * @return int
     */
    public function getUserId()
    {
        return $this->user_id;
    }

    /**
     * @param int $user_id
     */
    public function setUserId($user_id)
    {
        $this->user_id = $user_id;
    }

    /** @var string */
    protected $major = null;
    /** @var int */
    protected $user_id = null;
    /** @var int */
    protected $school_id = null;

}